Partial Public Class DocSiteLogin
	Inherits System.Web.UI.Page

	Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
		MyBase.OnInit(e)

		CType(Master, DocSite).EnsureRobotsMetaTag(True, True)
	End Sub

	Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)
		Form.DefaultButton = login.FindControl("LoginButton").UniqueID

		Dim userName As TextBox = CType(login.FindControl("UserName"), TextBox)
		userName.Attributes.Add("onfocus", "this.select();")

		Dim password As TextBox = CType(login.FindControl("Password"), TextBox)
		password.Attributes.Add("onfocus", "this.select();")

		If userName.Text.Length > 0 Then
			password.Focus()
		Else
			userName.Focus()
		End If

		MyBase.OnPreRender(e)
	End Sub

	Protected Sub login_Authenticate(ByVal sender As Object, ByVal e As AuthenticateEventArgs)
		e.Authenticated = FormsAuthentication.Authenticate(login.UserName, login.Password)
	End Sub

End Class